<div class="content_right_title_admin">
Thêm dịch vụ nổi bật
</div> 

<div style="min-height:470px; float:left; margin-right:5px" class="content_right_group_admin box_shadow">




<?php

if(!isset($_REQUEST['key'])):

	header("location:trangchu.php");

elseif(!isset($_REQUEST['madm'])):

	include_once("../../coms/xl_danhmuc.php");

	$dm = new xl_danhmuc();

	$arr_dmsp = $dm->Load_danh_muc();

	

?>

	<div style="text-align:center"><span style="color:#006; font-size:25px; font-weight:bold"> Chọn danh mục</span></div>

	<table width="60%" cellpadding="5" cellspacing="0" style="padding-left:5px; padding-right:5px;margin-top:0" id="myTable" align="center" >    

        <tr bgcolor="#999999">

            <th align="center" valign="middle">

                STT

            </th>

            <th align="center" valign="middle">

                Tên danh mục

            </th>

            <th align="center" valign="middle">

                Chức năng

            </th>

            

        </tr>

<?php

	for($i = 0 ; $i < count($arr_dmsp); $i++)	

	{

		$row = $arr_dmsp[$i];	

		echo '<tr">

				<td align="center" valign="middle">

					'.($i+1).'

				</td>

				<td align="center" valign="middle">

					<a href="trangchu.php?key=t_qlnb&madm='.$row['madanhmuc'].'">'.$row['tendanhmuc'].'</a>

				</td>

				<td align="center" valign="middle">

					<a href="trangchu.php?key=t_qlnb&madm='.$row['madanhmuc'].'" class="button medium blue">Chọn</a>

				</td>

			</tr>';

		

	}

?>

     </table>





<?php	

else:

	include_once("../../coms/xl_trang.php");	

	$MaDanhMuc = $_REQUEST['madm'];	

	$lt = new xl_trang();

	$arr_lt = $lt->Load_DichVuTheoMaLoaiTrang($MaDanhMuc);

	if(isset($_REQUEST['act']) && isset($_REQUEST['id'])):

		$act = $_REQUEST['act'];

		$id = $_REQUEST['id'];

		if($act == 'nb' && is_numeric($id)):

			$noibat = new xl_trang();

			$kq2 = $noibat->them_dichvu_noibat($id);

			echo '<script type="text/javascript">

						alert("Chọn dịch vụ nổi bật thành công!!!");					

					</script>';

			echo '<meta http-equiv="refresh" content="0;url=trangchu.php?key=qlnb"  />';

		endif;

	endif;		

?>

   

<div id="list_tin_moi" style="padding-bottom:5px; border:0;">

    <div style="text-align:center"><h3> <span style="color:#006"> Chọn dịch vụ nổi bật</span></h3></div>

    <table width="100%" cellspacing="0" style="padding-left:5px; padding-right:5px;" id="myTable" >

        <tr bgcolor="#999999">

            <th align="center" valign="middle">

                STT

            </th>

            <th align="center" valign="middle">

                Tên dịch vụ

            </th>

            <th align="center" valign="middle">

                Chức năng

            </th>

        </tr>

    <?php

    for ($i=0; $i<count($arr_lt); $i++):

        $row = $arr_lt[$i];

    ?>

        <tr>

            <td align="center" valign="middle">

                <?php echo $i+1; ?>

            </td>

            <td align="center" valign="middle">

                <?php echo $row['tentrang']; ?>

            </td>

            <td align="center" valign="middle" >

            	<?php 

				if($row['noibat']==1):

					echo '<span style="color:#F00">Là dịch vụ nổi bật</span>';

				else:

				?>

            

                 <a href="trangchu.php?key=t_qlnb&madm=<?php echo $MaDanhMuc ?>&act=nb&id=<?php echo $row['matrang']; ?>" class="button medium blue">Chọn</a>

                 <?php endif; ?>

            </td>

        </tr>

    <?php

    endfor;

    ?>

    </table>

    

   

</div>

<?php

endif;

?>

</div>

